package com.tedu;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import org.junit.Test;

public class JdbcTest01 {
	@Test
	public void testA() throws Exception{
		Class.forName("com.mysql.cj.jdbc.Driver");
		Connection a = DriverManager.getConnection(
				"jdbc:mysql:///jt_db?serverTimezone=Asia/Shanghai&characterEncoding=utf-8",
				"root","root");
		Statement b = a.createStatement();
		String c="select * from account";
		ResultSet d = b.executeQuery(c);
		while(d.next()) {
			int e=d.getInt("id");
			String f=d.getString("name");
			double g=d.getDouble("money");
		}
		d.close();
		b.close();
		a.close();
	}
}
